public class SimpleGenericExample {

  public static void main(String[] args) {

    new SimpleGeneric<String>("Hello World").printType();
    new SimpleGeneric<Boolean>(Boolean.TRUE).printType();
  }

}

class SimpleGeneric<T> {

  private T object = null;

  public SimpleGeneric(T object) {
    this.object = object;
  }

  public T getObject() {
    return this.object;
  }

  public void printType() {
    System.out.println("Type: " + object.getClass().getName());
  }
}
